package com.cdks.wuxiu.api.service.redis;

import java.util.Map;
import java.util.Set;

import com.cdks.wuxiu.api.model.dto.CloudStorageDTO;
import com.cdks.wuxiu.api.model.dto.KmsgDataDTO;

public interface RedisService {
    //短信通道
    int setSmsCode(String phone, String code);
    int addSmsCount(String phone);
    int decSmsCount(String phone);
    String getSmsCode(String phone);

    //用户认证
    boolean setUserToken(long userId, String encToken, boolean force);
    boolean setChalln(long userId, String challn);
    int delUserToken(long userId);
    String getUserToken(long userId);
    String getChalln(long userId);

    //kmsg
    int setKmsgAuthData(long userId, KmsgDataDTO dto);
    String getKmsgAuthData(long userId);

    //云存
    int setOssAuthData(CloudStorageDTO ossData);
    String getOssAuthData();
    
    //通话
    int setCallKeepTime(long userId, long time, String ucid);
    int getCallKeepTime(long userId, String ucid);
    int setCallToken(long userId, String ucid, String callToken);
    String getCallToken(long userId, String ucid);

    //消息流控
    int getMessageRate(long senderId, long recverId);
    int delMessageRate(long senderId, long recverId);
    int addMessageRate(long senderId, long recverId);
    int decMessageRate(long senderId, long recverId);
    int ttlMessageRate(long senderId, long recverId);
    int addMessageCount(long senderId, long recverId);
    int ttlChatBanTime(long senderId);
    int addChatBanCount(long senderId);
    int setLastMessageMd5(long userId, String md5);
    int saveRepeatMessage(long userId, String md5, String msg);
    String getLastMessageMd5(long userId);

    //邀请
    String getInviterInfo(String ip);
    
    //通话提醒
    int saveNoticedCallee(long userId, long matchUserId);
    Set<String> getNoticedCallee(long userId);

    //通话录音
    int setRecordStart(String ucid);
    int saveRecordInfo(String ucid, Map<String, Object> info);
    Map<Object, Object> getRecordInfo(String ucid);

    //一键倾诉
    int saveRandCall(long caller, long callee);
    int removeRandCall(long caller, long callee);
    int deleteRandCall(long caller);
    Set<String> getRandCall(long caller);

    //离线通话
    int saveWaitCall(long userId, String ucid);
    int removeWaitCall(long callee, String ucid);
    String getWaitCall(long callee);
}
